package java01;

public class homework04 {
	public static void main(String[] argc){
		
		int a,b,c,d,e;
		for (int i=9;i<=99999;i++){
			if (i<100){
				a=i%10;
				b=i/10;
				if (a==b){
					System.out.println(i);
				}
			}else if (i<1000){
				a=i%10;
				b=i%100/10;
				c=i/100;
				if (a==c){
					System.out.println(i);
				}
			}else if (i<10000){
				a=i%10;
				b=i%100/10;
				c=i%1000/100;
				d=i/1000;
				if (a==d && b==c){
					System.out.println(i);
				}
			}else{
				a=i%10;
				b=i%100/10;
				c=i%1000/100;
				d=i%10000/1000;
				e=i/10000;
				if(a==e && b==d){
					System.out.println(i);
				}
			}
		}
	}
}
